package com.test.redis;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.data.redis.core.RedisTemplate;

import java.time.Duration;

/**
 * @author zxs
 * @since 2021/6/16
 */
@SpringBootApplication
public class RedisApplication {

    public static void main(String[] args) {
        ConfigurableApplicationContext applicationContext = SpringApplication.run(RedisApplication.class,args);
        RedisTemplate<String,String> template = applicationContext.getBean(RedisTemplate.class);
        String value = template.opsForList().leftPop("test", Duration.ofSeconds(30));
        System.out.println(value);
        //applicationContext.close();
    }
}
